<!doctype html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<title>后台登录-X-admin1.1</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
		<link rel="stylesheet" href="./css/font.css">
		<link rel="stylesheet" href="./css/xadmin.css">
		<link rel="stylesheet" href="https://cdn.bootcss.com/Swiper/3.4.2/css/swiper.min.css">
		<script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
		<script type="text/javascript" src="https://cdn.bootcss.com/Swiper/3.4.2/js/swiper.jquery.min.js"></script>
		<script src="./lib/layui/layui.js" charset="utf-8"></script>
		<script type="text/javascript" src="./js/xadmin.js"></script>
		<script type="text/javascript" src="js/jquery.validate.js"></script>
	</head>
	<body>
		<!-- 中部开始 -->
		<div class="wrapper">
			<!-- 右侧主体开始 -->
			<div class="page-content">
				<div class="content">
					<!-- 右侧内容框架，更改从这里开始 -->
					<form class="layui-form" action="../../api/manage/addUser.form">
						<div class="layui-form-item">
							<label for="L_email" class="layui-form-label">
								<span class="x-red">*</span>用户名
							</label>
							<div class="layui-input-inline">
								<input type="text" id="username" name="userName" required="" autocomplete="off" class="layui-input">
							</div>
							<div class="layui-form-mid layui-word-aux">
								<span class="x-red">*</span>将会成为您唯一的登入名
							</div>
						</div>
						<div class="layui-form-item">
							<label for="L_email" class="layui-form-label">
								<span class="x-red">*</span>手机号码
							</label>
							<div class="layui-input-inline">
								<input type="text" id="phone" name="phone" required="" autocomplete="off" class="layui-input">
							</div>
							<div class="layui-form-mid layui-word-aux">
								<span class="x-red">*</span>
							</div>
						</div>
						<div class="layui-form-item">
							<label for="L_pass" class="layui-form-label">
								<span class="x-red">*</span>密码
							</label>
							<div class="layui-input-inline">
								<input type="password" id="L_pass" name="password" required="" lay-verify="pass" autocomplete="off" class="layui-input">
							</div>
							<div class="layui-form-mid layui-word-aux">
								6到16个字符
							</div>
						</div>
						<div class="layui-form-item">
							<label for="L_repass" class="layui-form-label">
								<span class="x-red">*</span>确认密码
							</label>
							<div class="layui-input-inline">
								<input type="password" id="L_repass" name="repass" required="" lay-verify="repass" autocomplete="off" class="layui-input">
							</div>
						</div>
						<div class="layui-form-item">
							<label for="L_repass" class="layui-form-label">
							</label>
							<button class="layui-btn" lay-filter="add" lay-submit="">
								增加
							</button>
						</div>
					</form>
					<!-- 右侧内容框架，更改从这里结束 -->
				</div>
			</div>
			<!-- 右侧主体结束 -->
		</div>
		<!-- 中部结束 -->
		<script>
			$(function() {
				$(".layui-form").validate({
					rules: {
						username: {
							required: true
						},
						password: {
							required: true,
							minlength: 3
						},
						repass: {
							required: true,
							equalTo: "#L_pass"

						}

					},
					messages: {
						username: {
							required: "请输入账号",
							minlength: "账号至少1位",
							remote: "账号已存在"
						},
						newpass: {
							required: "请输入密码",
							minlength: "密码至少3位"
						},
						repass: {
							required: "请输入确认密码",
							equalTo: "两次密码不相同"
						}

					},
					errorPlacement: function(error, element) {

						layer.msg($(error).text());
					},
					submitHandler: function(form) {
						layer.msg("添加成功");
						form.submit();
						parent.location.reload();
					}
				});
			});
		</script>
	</body>
</html>
